package ihotel

abstract class BaseController {
	
	def beforeInterceptor = [action:this.&auth, except:['login', 'handleLogin']]
	
	def auth() {
	
		if (!session.funcionario) {
			session.forward = actionUri
	
			if (params.id) {
				session.forward += '/' + params.id	
			}
	
			redirect(controller: 'funcionario', action:'login')
	
			return false
		}
	}
}